package com.fire.control.system.module.user.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.fire.control.system.entity.User;
/***
 * 
 * @ClassName:  UserDao   
 * @Description:用户持久层
 * @author:   chenchuang
 * @date:   2017年5月6日 下午3:31:13   
 *
 */
@Repository 
public interface UserRepository extends JpaRepository<User, String>{
	
	@Query("from User u where u.loginName = :loginName")
	public User findByLoginNameAndPassword(@Param("loginName")String loginName);
	
	@Query("from User u where u.id = :uid")
	public User getUserInfo(@Param("uid")String uid);

	public List<User> findByName(String userName);
	
}
